/*     */ package com.lmpop.trade.ti_inquiry;
/*     */ 
/*     */ import com.lmpop.frame.QueryList;
/*     */ import com.lmpop.frame.SysMap;
/*     */ import com.lmpop.frame.TradeInterf;
/*     */ import com.lmpop.frame.dao.DbmInterf;
/*     */ import com.lmpop.frame.dao.IbatisDbmImpl;
/*     */ import com.lmpop.frame.exp.ApplicationException;
/*     */ import com.lmpop.frame.util.RandomID;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ 
/*     */ public class Ti_inquiryInfo
/*     */   implements TradeInterf
/*     */ {
/*     */   QueryList queryList;
/*     */ 
/*     */   public Ti_inquiryInfo()
/*     */   {
/*  18 */     this.queryList = new QueryList();
/*     */   }
/*     */ 
/*     */   public SysMap insert(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  28 */     String trade_id = new RandomID().GenTradeId();
/*     */ 
/*  30 */     String yancodetip = map.getString("yancodetip");
/*     */ 
/*  32 */     String userrand = map.getString("userrand");
/*  33 */     String randcode = map.getString("randcode");
/*     */ 
/*  35 */     Ti_inquiry ti_inquiry = new Ti_inquiry();
/*  36 */     ti_inquiry.setTrade_id(trade_id);
/*  37 */     ti_inquiry.setInfo_id(map.getString("info_id"));
/*  38 */     ti_inquiry.setTitle(map.getString("title"));
/*  39 */     ti_inquiry.setOrder_num(map.getString("order_num"));
/*  40 */     String req_price = map.getString("req_price");
/*  41 */     if ((req_price == null) || ("".equals(req_price)))
/*  42 */       req_price = "0.00";
/*  43 */     ti_inquiry.setReq_price(req_price);
/*  44 */     ti_inquiry.setContent(map.getString("content"));
/*  45 */     ti_inquiry.setReq_date(map.getString("req_date"));
/*  46 */     ti_inquiry.setReq_file(map.getString("req_file"));
/*  47 */     ti_inquiry.setRe_name(map.getString("re_name"));
/*  48 */     ti_inquiry.setReq_compname(map.getString("req_compname"));
/*  49 */     ti_inquiry.setReq_email(map.getString("req_email"));
/*  50 */     ti_inquiry.setReq_phone(map.getString("req_phone"));
/*  51 */     ti_inquiry.setCust_id(map.getString("cust_id"));
/*  52 */     ti_inquiry.setUser_id(map.getString("user_id"));
/*  53 */     ti_inquiry.setRemark(map.getString("remark"));
/*  54 */     ti_inquiry.setBiz_type(map.getString("biz_type"));
/*  55 */     String result_code = "0";
/*  56 */     String result_info = "";
/*  57 */     if ((userrand != null) && (!userrand.equals("")) && (!randcode.equals(""))) {
/*  58 */       if (userrand.trim().equals(randcode.trim())) {
/*     */         try {
/*  60 */           insert(dbmMgr, ti_inquiry);
/*     */         } catch (ApplicationException e) {
/*  62 */           e.printStackTrace();
/*  63 */           result_code = "1";
/*     */         }
/*     */       } else {
/*  66 */         result_info = yancodetip;
/*  67 */         result_code = "1";
/*     */       }
/*     */     }
/*     */     else try {
/*  71 */         insert(dbmMgr, ti_inquiry);
/*     */       } catch (ApplicationException e) {
/*  73 */         e.printStackTrace();
/*  74 */         result_code = "1";
/*     */       }
/*     */ 
/*     */ 
/*  79 */     map.setString("result_info", result_info);
/*  80 */     map.setString("result_code", result_code);
/*  81 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert(DbmInterf dbmMgr, Ti_inquiry ti_inquiry)
/*     */     throws ApplicationException
/*     */   {
/*  90 */     dbmMgr.update("insertTi_inquiry", ti_inquiry);
/*     */   }
/*     */ 
/*     */   public SysMap insert_lianhesw(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  96 */     String yancodetip = map.getString("yancodetip");
/*  97 */     String userrand = map.getString("userrand");
/*  98 */     String randcode = map.getString("randcode");
/*     */ 
/* 100 */     Ti_inquiry ti_inquiry = new Ti_inquiry();
/* 101 */     ti_inquiry.setTrade_id(map.getString("trade_id"));
/* 102 */     ti_inquiry.setInfo_id(map.getString("info_id"));
/* 103 */     ti_inquiry.setTitle(map.getString("title"));
/* 104 */     ti_inquiry.setOrder_num(map.getString("order_num"));
/* 105 */     ti_inquiry.setContent(map.getString("content"));
/* 106 */     ti_inquiry.setRe_name(map.getString("re_name"));
/* 107 */     ti_inquiry.setReq_compname(map.getString("req_compname"));
/* 108 */     ti_inquiry.setReq_email(map.getString("req_email"));
/* 109 */     ti_inquiry.setReq_phone(map.getString("req_phone"));
/* 110 */     ti_inquiry.setCust_id(map.getString("cust_id"));
/* 111 */     ti_inquiry.setUser_id(map.getString("user_id"));
/* 112 */     ti_inquiry.setRemark(map.getString("remark"));
/* 113 */     ti_inquiry.setBiz_type(map.getString("biz_type"));
/* 114 */     ti_inquiry.setRsrv_str1(map.getString("rsrv_str1"));
/* 115 */     ti_inquiry.setRsrv_str2("0");
/* 116 */     ti_inquiry.setRsrv_str3(map.getString("rsrv_str3"));
/* 117 */     String result_code = "0";
/* 118 */     String result_info = "";
/*     */     try
/*     */     {
/* 121 */       float price = Float.parseFloat(map.getString("biz_price").toString());
/* 122 */       map.setString("price", String.valueOf(price));
/* 123 */       ti_inquiry.setReq_price(String.valueOf(price));
/*     */ 
/* 125 */       insert_lianhesw(dbmMgr, ti_inquiry);
/*     */     }
/*     */     catch (ApplicationException e) {
/* 128 */       e.printStackTrace();
/* 129 */       result_code = "1";
/*     */     }
/*     */ 
/* 132 */     map.setString("result_info", result_info);
/* 133 */     map.setString("result_code", result_code);
/* 134 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert_lianhesw(DbmInterf dbmMgr, Ti_inquiry ti_inquiry) throws ApplicationException {
/* 138 */     dbmMgr.update("insertTi_inquiryByLhsw", ti_inquiry);
/* 139 */     dbmMgr.update("updateModelNum", ti_inquiry.getTrade_id());
/*     */   }
/*     */ 
/*     */   public SysMap delete(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 149 */     String pkid_string = map.getString("pkid");
/* 150 */     String result_code = "0";
/*     */     try {
/* 152 */       if (!pkid_string.equals("")) {
/* 153 */         String[] pkStr = pkid_string.split("\\|");
/* 154 */         for (int i = 0; i < pkStr.length; i++) {
/* 155 */           if (pkStr[i].equals("")) continue; delete(dbmMgr, pkStr[i]);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/* 159 */       e.printStackTrace();
/* 160 */       result_code = "1";
/*     */     }
/* 162 */     map.setString("result_code", result_code);
/* 163 */     return map;
/*     */   }
/*     */ 
/*     */   public void delete(DbmInterf dbmMgr, String pkid)
/*     */     throws ApplicationException
/*     */   {
/* 172 */     dbmMgr.update("deleteTi_inquiry", pkid);
/*     */   }
/*     */ 
/*     */   public SysMap update(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 181 */     Ti_inquiry ti_inquiry = new Ti_inquiry();
/* 182 */     ti_inquiry.setTrade_id(map.getString("trade_id"));
/* 183 */     ti_inquiry.setInfo_id(map.getString("info_id"));
/* 184 */     ti_inquiry.setTitle(map.getString("title"));
/* 185 */     ti_inquiry.setOrder_num(map.getString("order_num"));
/* 186 */     ti_inquiry.setReq_price(map.getString("req_price"));
/* 187 */     ti_inquiry.setContent(map.getString("content"));
/* 188 */     ti_inquiry.setReq_date(map.getString("req_date"));
/* 189 */     ti_inquiry.setReq_file(map.getString("req_file"));
/* 190 */     ti_inquiry.setRe_name(map.getString("re_name"));
/* 191 */     ti_inquiry.setReq_compname(map.getString("req_compname"));
/* 192 */     ti_inquiry.setReq_email(map.getString("req_email"));
/* 193 */     ti_inquiry.setReq_phone(map.getString("req_phone"));
/* 194 */     ti_inquiry.setRsrv_str1(map.getString("rsrv_str1"));
/* 195 */     ti_inquiry.setRsrv_str2(map.getString("rsrv_str2"));
/* 196 */     ti_inquiry.setRsrv_str3(map.getString("rsrv_str3"));
/* 197 */     ti_inquiry.setCust_id(map.getString("cust_id"));
/* 198 */     ti_inquiry.setIn_date(map.getString("in_date"));
/* 199 */     ti_inquiry.setUser_id(map.getString("user_id"));
/* 200 */     ti_inquiry.setRemark(map.getString("remark"));
/* 201 */     ti_inquiry.setBiz_type(map.getString("biz_type"));
/*     */ 
/* 203 */     String result_code = "0";
/*     */     try {
/* 205 */       update(dbmMgr, ti_inquiry);
/*     */     } catch (ApplicationException e) {
/* 207 */       e.printStackTrace();
/* 208 */       result_code = "1";
/*     */     }
/* 210 */     map.setString("result_code", result_code);
/* 211 */     return map;
/*     */   }
/*     */ 
/*     */   public void update(DbmInterf dbmMgr, Ti_inquiry ti_inquiry)
/*     */     throws ApplicationException
/*     */   {
/* 220 */     dbmMgr.update("updateTi_inquiry", ti_inquiry);
/*     */   }
/*     */ 
/*     */   public List getListByPage(Object obj, int start, int limit)
/*     */   {
/* 230 */     Map ti_inquiry = (Hashtable)obj;
/* 231 */     if (start == 0)
/* 232 */       start = 0;
/*     */     else {
/* 234 */       start = (start - 1) * limit;
/*     */     }
/* 236 */     ti_inquiry.put("start", Integer.valueOf(start));
/* 237 */     ti_inquiry.put("limit", Integer.valueOf(limit));
/* 238 */     return this.queryList.getList("getListByTi_inquiryPage", ti_inquiry);
/*     */   }
/*     */ 
/*     */   public List getTi_inquiryOrderList(Object obj, int start, int limit) {
/* 242 */     Map ti_inquiry = (Hashtable)obj;
/* 243 */     if (start == 0)
/* 244 */       start = 0;
/*     */     else {
/* 246 */       start = (start - 1) * limit;
/*     */     }
/* 248 */     ti_inquiry.put("start", Integer.valueOf(start));
/* 249 */     ti_inquiry.put("limit", Integer.valueOf(limit));
/* 250 */     return this.queryList.getList("getTi_inquiryOrderList", ti_inquiry);
/*     */   }
/*     */ 
/*     */   public int getCountByObj(Object obj)
/*     */   {
/* 260 */     Map ti_inquiry = (Hashtable)obj;
/* 261 */     List list = this.queryList.getList("getCountByObjTi_inquiry", ti_inquiry);
/* 262 */     int count = 0;
/* 263 */     if ((list != null) && (list.size() > 0)) {
/* 264 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 265 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 266 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 269 */     return count;
/*     */   }
/*     */ 
/*     */   public String getSumByObj(Object obj) {
/* 273 */     Map ti_inquiry = (Hashtable)obj;
/* 274 */     List list = this.queryList.getList("getSumByObjTi_inquiry", ti_inquiry);
/* 275 */     String count = "";
/* 276 */     if ((list != null) && (list.size() > 0)) {
/* 277 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 278 */       if ((newsMap.get("sumnum") != null) && (!newsMap.get("sumnum").toString().equals(""))) {
/* 279 */         count = newsMap.get("sumnum").toString();
/*     */       }
/*     */     }
/* 282 */     return count;
/*     */   }
/*     */ 
/*     */   public List getListByPk(String pk)
/*     */   {
/* 291 */     return this.queryList.getList("getTi_inquiryByPk", pk);
/*     */   }
/*     */ 
/*     */   public void updateTi_inquiryOrderState(Map map)
/*     */   {
/* 296 */     DbmInterf dbmMgr = new IbatisDbmImpl();
/* 297 */     dbmMgr.updateSql("updateTi_inquiryOrderState", map);
/*     */   }
/*     */ 
/*     */   public SysMap updateTi_inquiryOrderDeal(DbmInterf dbmMgr, SysMap map) {
/* 301 */     Map ti_inquiry = new Hashtable();
/* 302 */     ti_inquiry.put("trade_id", map.getString("trade_id"));
/* 303 */     ti_inquiry.put("rsrv_str2", map.getString("rsrv_str2"));
/*     */ 
/* 305 */     String result_code = "0";
/*     */     try
/*     */     {
/* 309 */       updateTi_inquiryOrderDeal(ti_inquiry);
/*     */     } catch (ApplicationException e) {
/* 311 */       e.printStackTrace();
/* 312 */       result_code = "1";
/*     */     }
/* 314 */     map.setString("result_code", result_code);
/* 315 */     return map;
/*     */   }
/*     */   public void updateTi_inquiryOrderDeal(Map map) throws ApplicationException {
/* 318 */     DbmInterf dbmMgr = new IbatisDbmImpl();
/* 319 */     dbmMgr.updateSql("updateTi_inquiryOrderDeal", map);
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.ti_inquiry.Ti_inquiryInfo
 * JD-Core Version:    0.6.0
 */